Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Address linting issues #12851

Closed
wants to merge 19 commits into from
Closed

Conversation

faddat
Copy link
Contributor

@faddat faddat commented Aug 8, 2022

Description

This PR addresses linting issues prior to go 1.19 usage.

  • change to gofumpt to avoid conflicts between nolintlint and gofmt and goimports
  • run linter with go 1.19
  • lint the repository

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@faddat faddat requested a review from a team as a code owner August 8, 2022 13:53
@faddat faddat changed the title chore: use the linter chore: Use canonical golangci-lint github action Aug 8, 2022
@github-actions github-actions bot added the C:orm label Aug 8, 2022
@faddat faddat marked this pull request as draft August 8, 2022 17:32
@alexanderbez
Copy link
Contributor

Awesome work and thank you!!!

@faddat faddat changed the title chore: Use canonical golangci-lint github action chore: Address linting issues Aug 9, 2022
@faddat faddat marked this pull request as ready for review August 9, 2022 05:29
CHANGELOG.md Outdated
@@ -45,6 +45,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Improvements

* (ci) [#12851](https://github.com/cosmos/cosmos-sdk/pull/12851) lint grandfathered issues
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't think this is needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@@ -3,7 +3,7 @@ module github.com/cosmos/cosmos-sdk/cosmovisor
go 1.18

require (
github.com/cosmos/cosmos-sdk v0.46.0
github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20220808215643-b6791b7af44b
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be 0.46.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I see. This can cause a thing....

Will take me a moment to figure out.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is because you did go work sync after having added cosmovisor in the go.work

Copy link
Member

@julienrbrt julienrbrt Aug 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@faddat, meaculpa, removing this was breaking make test. We have a few solutions to fix that:

  • In run-tests (Makefile), add GOWORK=off before running go test. This requires (although I think it's good), packages to be properly tagged to pass CI.
  • Accept that it will upgrade the tendermint version until the SDK is downgrading to 34.x on main as well (as the support of 0.35 is anyway dropped by TM)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am actually for doing both, merging with cosmovisor in the go.work but then still disable it in the CI runs to force us to tag properly our versions. Wdyt @faddat, @marbar3778?

@@ -5,6 +5,7 @@ use (
./api
./client/v2
./core
./cosmovisor
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we decided to remove this? @julienrbrt you did something related to this no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will likely need to be re-removed, then its removal will cause some kind of issue I don't fully understand.

Copy link
Member

@julienrbrt julienrbrt Aug 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your issue was in go 1.19 PR you said right? So it won't happen in this PR anyway :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dp := v1.NewDepositParams(params.MinDeposit, params.MaxDepositPeriod)
vp := v1.NewVotingParams(params.VotingPeriod)
tp := v1.NewTallyParams(params.Quorum, params.Threshold, params.VetoThreshold)
dp := v1.NewDepositParams(params.MinDeposit, params.MaxDepositPeriod) //nolint:staticcheck // TODO: refactor to only refer to Params
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the todos

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wasn't sure how to fix-- also if to fix.

Is fix simply getting rid of everything that works like params.Thingy ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(or, is it just wrong, and the todos aren't needed?)

@faddat
Copy link
Contributor Author

faddat commented Aug 9, 2022

if this passes 00 and 01 I'd say that it is ready.

also, the diff between the most recent commit and the one before might be interesting, as I don't think that anything that was changed, should have affected those tests.

@faddat
Copy link
Contributor Author

faddat commented Aug 9, 2022

That did not work.

let's see where this one leaves us-- it reverts changes to snapshots.

I am flummoxed.

@faddat
Copy link
Contributor Author

faddat commented Aug 9, 2022

Apologies. I think that there is something deficient in this branch, and that it is most prudent to do-over from main.

@faddat faddat marked this pull request as draft August 9, 2022 09:11
@faddat faddat mentioned this pull request Aug 9, 2022
19 tasks
@julienrbrt
Copy link
Member

Superseded by #12867

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants